package com.company;

/**
 * @description: some desc
 * @author: ruoan
 * @date: 2020/10/23 9:20
 */
public class Demo {


    public static void main(String[] args) {
        String a = "helloworld";
        String b = a.intern();
        String c = new String("helloworld");
        System.out.println(a==b);
        System.out.println(a==c);

        MyString myString1 = new MyString();
        MyString myString2 = new MyString();
        System.out.println(myString1);
        System.out.println(myString2);
        System.out.println(myString1==myString2);
        System.out.println(myString1.equals(myString2));

    }
}


class MyString {

    @Override
    public boolean equals(Object obj) {
        return true;
    }


}